home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 6 / CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso / cucd / online / fidonetts / fsc-0072.ext < prev    next >
Text File  |  1993-02-21  |  112KB  |  1,906 lines

  1. Document: FSC-0072
  2. Version:  001
  3. Date:     21-Feb-1993
  4.  
  5.  
  6.  
  7.  
  8.                     The HYDRA file transfer protocol
  9.  
  10.                Joaquim H. Homrighausen and Arjen G. Lentz
  11.  
  12.  
  13.  
  14.  
  15. Status of this document:
  16.  
  17.      This FSC suggests a proposed protocol for the FidoNet(r) community,
  18.      and requests discussion and suggestions for improvements.
  19.      Distribution of this document is subject to the restrictions listed
  20.      below.
  21.  
  22.      Fido and FidoNet are registered marks of Tom Jennings and Fido
  23.      Software.
  24.  
  25.  
  26.  
  27.  
  28.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  29.      Copyright 1991-1993 Joaquim H. Homrighausen. All rights reserved.
  30.      Copyright 1991-1993 Lentz Software Development. All rights reserved.
  31.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  32.  
  33.  
  34.     Restrictions
  35.     ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
  36.     You are granted a license to implement the HYDRA file transfer
  37.     protocol, HYDRA hereafter, in your own programs and/or use the sample
  38.     source code and adapt these to your particular situation and needs;
  39.     subject to the following conditions:
  40.  
  41.     o You must refer to it as the HYDRA file transfer protocol, and you
  42.       must give credit to the authors of HYDRA in any information screens
  43.       or literature pertaining to your programs that contains other such
  44.       information (credits, your own copyrights, etc.).
  45.  
  46.     o HYDRA will always remain backwards compatible with previous
  47.       revisions. HYDRA allows for expansion of its features without
  48.       interfering with previous revisions. It is, however, important that
  49.       different people do not expand the protocol in different directions.
  50.       We therefore ask you to contact us if you have any needs/ideas
  51.       regarding HYDRA, so development can be synchronized and beneficial
  52.       to all.
  53.  
  54.     o If your implementation cannot converse with past or future revisions
  55.       as supplied by us, then you must refer to it as "HYDRA derived", or
  56.       as "a variation of HYDRA", or words to that effect.
  57.  
  58.     Permission is hereby granted to the FTSC (FidoNet Technical Standards
  59.     Committee) and other technical organisations to republish this
  60.     document in its entirety. Librarians may change the title page and
  61.     page headers to match their library format as long as all copyrights
  62.     and body text remain unaltered. The original document name and source
  63.     must be mentioned in any republished versions of this document.
  64.  
  65.     No organization, company, person, or other being may impose any fees
  66.     for any reason for providing this document. This document may not be
  67.     sold or otherwise transferred for personal or company gain under any
  68.     circumstances.
  69.  
  70.  
  71.     Disclaimer
  72.     ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
  73.     This information is provided "as is" and comes with no warranties of
  74.     any kind, either expressed or implied. There is no support available
  75.     for this package. It's intended to be used by programmers and
  76.     developers.
  77.  
  78.     In no event shall the authors be liable to you or anyone else for any
  79.     damages, including any lost profits, lost savings or other incidental
  80.     or consequential damages arising out of the use or inability to use
  81.     this information.
  82.  
  83.  
  84.     Revision timestamps
  85.     ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
  86.     001                           0x2b1aab00                 Dec 01, 1992
  87.  
  88.  
  89.     Introduction
  90.     ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
  91.     This document will not attempt to convince the reader that HYDRA is
  92.     of value to him/her or that it is better than other file transfer
  93.     protocols, it will simply describe the protocol. Just to get it out
  94.     of the way, HYDRA is not the ultimate file transfer protocol.
  95.  
  96.     The authors do, however, feel that it offers an significant
  97.     improvement over those file transfer protocols available today. HYDRA
  98.     is a bi-directional protocol with the ability to receive and send
  99.     files simultaneously. There are other bi-directional file transfer
  100.     protocols, but to the authors' knowledge no public specifications
  101.     exist.
  102.  
  103.     HYDRA owes much to Zmodem and its designer, Chuck Forsberg as well as
  104.     to Janus, designed by Rick Huebner. We would like to think of HYDRA
  105.     as a combination of both with a few extra options installed.
  106.  
  107.     The basic concept of a bi-directional file transfer protocol is
  108.     simple. Both data channels are utilized to transmit and receive files
  109.     simultaneously. I.e. two 100 kb files can be exchanged between two
  110.     parties in the time it takes a fully streaming uni-directional file
  111.     transfer protocol to transmit one of the files.
  112.  
  113.  
  114.     Protocol design
  115.     ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
  116.     The ultimate goal when designing HYDRA was to design a protocol that
  117.     is as simple and robust as possible; complexity increase the problem
  118.     of faulty implementations.
  119.  
  120.     The obvious function of a file transfer protocol is to transport a
  121.     collection of data from its source to its destination as efficient
  122.     possible and without jeopardizing the integrity of the data.
  123.  
  124.     The lack of data compression and lost packet management (as used in
  125.     Kermit and Super Kermit) is intentional. The authors feel that this
  126.     unnecessarily increases the complexity of the protocol.
  127.  
  128.     While HYDRA performs to its best on full duplex links, it should be
  129.     possible to use it on links using proprietary protocols such as the
  130.     US Robotics HST protocol which features one 14.4 kbps data channel
  131.     and one 450 bps back channel.
  132.  
  133.     The protocol design should be flexible enough for future enhancements
  134.     while maintaining backward compatibility.
  135.  
  136.  
  137.     Protocol requirements and restrictions
  138.     ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
  139.     HYDRA require that the link can handle ASCII character 24 (DLE) as
  140.     well as all ASCII characters in the range 32 through 126. All other
  141.     characters can be escaped or encoded by the protocol as required by
  142.     the link.
  143.  
  144.     Capability of the computer to perform simultaneous serial I/O as well
  145.     as simultaneous serial I/O combined with disk access is preferred,
  146.     but can be circumvented by opting for windowed transmission instead
  147.     of full streaming.
  148.  
  149.     HYDRA calls for the ability to check whether there is anything in the
  150.     serial input buffer (i.e. "peek-ahead"), but it doesn't mind if it
  151.     has to wait for a second if there is no data available (using for
  152.     instance the UNIX alarm() mechanism).
  153.  
  154.     The protocol is extremely tolerant with timeouts (i.e. satellite or
  155.     network delays) while still maintaining maximum reliability,
  156.     robustness, and throughput.
  157.  
  158.  
  159.     Terms and definitions
  160.     ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
  161.     A BYTE                   An 8-bit unsigned character.
  162.     A WORD                   A 16-bit unsigned integer.
  163.     A DWORD                  A 32-bit unsigned integer.
  164.     A LONG                   A 32-bit SIGNED integer.
  165.     FILE OFFSETS (position)  A long.
  166.     NUL                      The ASCII character 0.
  167.     BS                       The ASCII character 8.
  168.     CR                       The ASCII character 13.
  169.     XOFF                     The ASCII character 17.
  170.     XON                      The ASCII character 19.
  171.     H_DLE                    The HYDRA link escape character, ASCII 24
  172.                              (^X).
  173.     SP or SPACE              The ASCII character 32.
  174.     UNIX timestamp           A specific time and date expressed as the
  175.                              number of seconds since midnight, January
  176.                              1st, 1970. All UNIX timestamps used in HYDRA
  177.                              are expressed in local time.
  178.  
  179.     Multi-byte items are transmitted in "low-byte first" order, so big-
  180.     endian CPUs (like 680xx) need to do some byteswapping, depending on
  181.     the implementation.
  182.  
  183.     Values preceded by '0x' are in hexadecimal notation (base 16, 0..9
  184.     a..f). All values transmitted in hexadecimal notation must be
  185.     converted to lowercase characters and left-padded to their full
  186.     size with '0' prior to transmission. E.g. a WORD with the value 255
  187.     (decimal) is expressed as 00ff. A LONG with the value 255 (decmial)
  188.     is expressed as 000000ff.
  189.  
  190.     In formulas, "AND" means bitwise AND, "XOR" means bitwise Exclusive
  191.     OR, "NOT" is ones complement (i.e. all zeros become ones, all ones
  192.     become zeros). The ">>" is a shift operation to the right, "R >> 3"
  193.     means shift R three bits to the right.
  194.  
  195.  
  196.     General packet format
  197.     ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
  198.     All data exchange is done with framed packets protected by 16 or 32
  199.     bit CRC values appended to the packet data and packet type (low-
  200.     byte first). The only exception to this is the cancel sequence of 5
  201.     consecutive H_DLE characters.
  202.  
  203.     All packets except those with the type DATA are followed by a CR
  204.     (ASCII 13) to help get through some buffered environments and aid
  205.     possible debugging and/or tracing. If requested by the other side in
  206.     its INIT packet, packets can also be prefixed by a specific data
  207.     string which can include NULs, delays or break signals. Refer to the
  208.     section on the INIT packet for more information.
  209.  
  210.  
  211.                           Format of unframed packet
  212.  
  213.                 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  214.                 ~ Zero or more bytes packet dependent data ~
  215.                 ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  216.                 ³ Packet type byte                         ³
  217.                 ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  218.                 ³ CRC-16/32 of packet data and packet type ³
  219.                 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  220.  
  221.  
  222.                             Table of packet types
  223.  
  224.          ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  225.          ³Name    ³Character³ASCII³Description                     ³
  226.          ÃÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  227.          ³START   ³   'A'   ³  65 ³Startup sequence                ³
  228.          ³INIT    ³   'B'   ³  66 ³Session initialisation          ³
  229.          ³INITACK ³   'C'   ³  67 ³Response to INIT packet         ³
  230.          ³FINFO   ³   'D'   ³  68 ³File information                ³
  231.          ³FINFOACK³   'E'   ³  69 ³Response to FINFO packet        ³
  232.          ³DATA    ³   'F'   ³  70 ³File data packet                ³
  233.          ³DATAACK ³   'G'   ³  71 ³File data position ACK packet   ³
  234.          ³RPOS    ³   'H'   ³  72 ³Reposition request packet       ³
  235.          ³EOF     ³   'I'   ³  73 ³End of file packet              ³
  236.          ³EOFACK  ³   'J'   ³  74 ³Response to EOF packet          ³
  237.          ³END     ³   'K'   ³  75 ³End of session                  ³
  238.          ³IDLE    ³   'L'   ³  76 ³Idle (just saying I'm alive)    ³
  239.          ³DEVDATA ³   'M'   ³  77 ³Data to specified device     (1)³
  240.          ³DEVDACK ³   'N'   ³  78 ³Response to DEVDATA packet   (1)³
  241.          ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  242.  
  243.     (1) Support for DEVDATA and DEVDACK types is optional and indicated
  244.         in INIT state of a HYDRA session.
  245.  
  246.  
  247.                            Format of framed packet
  248.  
  249.                ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  250.                ³        H_DLE         ³Packet format byte  ³
  251.                ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  252.                ~               Encoded packet              ~
  253.                ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  254.                ³        H_DLE         ³End of framed packet³
  255.                ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  256.  
  257.  
  258.                             Table of packet formats
  259.  
  260.            ÚÄÄÄÄÂÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  261.            ³Name³Character³ASCII³Description                     ³
  262.            ÃÄÄÄÄÅÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  263.            ³END ³   'a'   ³  97 ³End of framed packet            ³
  264.            ³BIN ³   'b'   ³  98 ³Binary packet                   ³
  265.            ³HEX ³   'c'   ³  99 ³Hex encoded packet              ³
  266.            ³ASC ³   'd'   ³ 100 ³Shifted 7-bit encoded packet (1)³
  267.            ³UUE ³   'e'   ³ 101 ³UUencoded packet             (1)³
  268.            ÀÄÄÄÄÁÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  269.  
  270.     (1) Support for ASC and/or UUE formats is optional and indicated in
  271.         the INIT state of a HYDRA session.
  272.  
  273.  
  274.     Packet sender and receiver state charts
  275.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  276.  
  277. TXPKT (Sender)
  278. ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ¿
  279. ³State   ³Predicate(s)                  ³Action(s)                 ³Next state³
  280. ÃÄÄÄÄÄÄÄÄÅÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  281. ³Begin   ³1³pkttype == START or         ³format = HEXPKT           ³Format    ³
  282. ³        ³ ³pkttype == INIT or          ³                          ³          ³
  283. ³        ³ ³pkttype == INITACK or       ³                          ³          ³
  284. ³        ³ ³pkttype == END or           ³                          ³          ³
  285. ³        ³ ³pkttype == IDLE             ³                          ³          ³
  286. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  287. ³        ³2³Escape 8th bit (7 bit link) ³                          ³Coding    ³
  288. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  289. ³        ³3³else (no spc.pkt, 8bit link)³format = BINPKT           ³Format    ³
  290. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  291. ³Coding  ³1³escape all control chars &  ³format = UUEPKT           ³Format    ³
  292. ³        ³ ³UUENCODED packets allowed   ³                          ³          ³
  293. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  294. ³        ³2³ASCII packets allowed       ³format = ASCPKT           ³Format    ³
  295. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  296. ³        ³3³7 bit link &                ³format = HEXPKT           ³Format    ³
  297. ³        ³ ³escape all control chars &  ³                          ³          ³
  298. ³        ³ ³UUE/ASC pkts not allowed    ³                          ³          ³
  299. ÃÄÄÄÄÄÄÄÄÅÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  300. ³Format  ³                              ³Append format byte to data³CRC       ³
  301. ÃÄÄÄÄÄÄÄÄÅÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  302. ³CRC     ³1³format != HEXPKT &          ³Calc CRC-32 (data,pkttype)³Encode    ³
  303. ³        ³ ³CRC-32 allowed              ³Append one's complement of³          ³
  304. ³        ³ ³                            ³CRC to data, lowbyte first³          ³
  305. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  306. ³        ³2³else (HEXPKT or no CRC-32)  ³Calc CRC-16 (data,pkttype)³Encode    ³
  307. ³        ³ ³                            ³Append one's complement of³          ³
  308. ³        ³ ³                            ³CRC to data, lowbyte first³          ³
  309. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  310. ³Encode  ³1³format == BINPKT            ³BIN escape databuf        ³Prefix    ³
  311. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  312. ³        ³2³format == HEXPKT            ³HEX encode databuf        ³Prefix    ³
  313. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  314. ³        ³3³format == ASCPKT            ³ASC encode/escape databuf ³Prefix    ³
  315. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  316. ³        ³4³format == UUEPKT            ³UUE encode databuf        ³Prefix    ³
  317. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  318. ³Prefix  ³1³No more prefix characters   ³                          ³Transmit  ³
  319. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  320. ³        ³2³Prefix character ASCII 221  ³Send 1 second break signal³          ³
  321. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  322. ³        ³3³Prefix character ASCII 222  ³1 second delay            ³          ³
  323. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  324. ³        ³4³Prefix character ASCII 223  ³Transmit NUL (ASCII 0)    ³          ³
  325. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  326. ³        ³5³else (any other character)  ³Transmit character        ³          ³
  327. ÃÄÄÄÄÄÄÄÄÅÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  328. ³Transmit³                              ³Transmit H_DLE,format byte³Suffix    ³
  329. ³        ³                              ³Transmit encoded buffer   ³          ³
  330. ³        ³                              ³Transmit H_DLE,pktend byte³          ³
  331. ÃÄÄÄÄÄÄÄÄÅÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  332. ³Suffix  ³1³pkttype != DATA &           ³Transmit CR,LF (ASC 13,10)³Done      ³
  333. ³        ³ ³pktformat != BINPKT         ³                          ³          ³
  334. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  335. ³        ³2³else (pkttype == DATA or    ³                          ³Done      ³
  336. ³        ³ ³      pktformat == BINPKT)  ³                          ³          ³
  337. ÀÄÄÄÄÄÄÄÄÁÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ
  338.  
  339.  
  340. RXPKT (Receiver)
  341. ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ¿
  342. ³State   ³Predicate(s)                  ³Action(s)                 ³Next state³
  343. ÃÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  344. ³Reset   ³                              ³rxdle = 0                 ³NextByte  ³
  345. ³        ³                              ³format = 0                ³          ³
  346. ³        ³                              ³pktlen = 0                ³          ³
  347. ÃÄÄÄÄÄÄÄÄÅÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  348. ³NextByte³1³User wishes to abort session³Report reason for abort   ³Abort     ³
  349. ³        ³ ³or carrier lost             ³                          ³          ³
  350. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  351. ³        ³2³Byte available in inputbuf  ³                          ³StripIn   ³
  352. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  353. ³        ³3³braintimer expired          ³Report braindead situation³Abort     ³
  354. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  355. ³        ³4³Any other timer expired     ³Tell responsible party    ³          ³
  356. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  357. ³StripIn ³1³Escape 8th bit (7 bit link) ³c = c AND 0x7f (strip 8th)³StripC    ³
  358. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  359. ³        ³2³else (8 bit link)           ³                          ³StripC    ³
  360. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  361. ³StripC  ³1³Escape ctlchars with 8th set³n = c AND 0x7f (strip 8th)³Process   ³
  362. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  363. ³        ³2³else (let 8 bit ctl through)³n = c                     ³Process   ³
  364. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  365. ³Process ³1³c == H_DLE                  ³increment rxdle           ³DLE       ³
  366. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  367. ³        ³2³Escape XON/XOFF &           ³Eat these                 ³NextByte  ³
  368. ³        ³ ³n == XON or n == XOFF       ³                          ³          ³
  369. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  370. ³        ³3³Escape all control chars &  ³Eat these                 ³NextByte  ³
  371. ³        ³ ³n < 32 or n == 127          ³                          ³          ³
  372. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  373. ³        ³4³rxdle > 0                   ³                          ³Escape    ³
  374. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  375. ³        ³5³else (no eating or escaping)³                          ³Store     ³
  376. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  377. ³DLE     ³1³rxdle == 5                  ³Report remote wants abort ³Abort     ³
  378. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  379. ³        ³2³else (rxdle < 5)            ³                          ³NextByte  ³
  380. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  381. ³Escape  ³1³c == PKTEND                 ³                          ³PktEnd    ³
  382. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  383. ³        ³2³c == BINPKT                 ³format = BINPKT           ³PktStart  ³
  384. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  385. ³        ³3³c == HEXPKT                 ³format = HEXPKT           ³PktStart  ³
  386. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  387. ³        ³4³c == ASCPKT                 ³format = ASCPKT           ³PktStart  ³
  388. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  389. ³        ³5³c == UUEPKT                 ³format = UUEPKT           ³PktStart  ³
  390. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  391. ³        ³6³else (normal escaped char)  ³c = c XOR 0x40            ³Store     ³
  392. ³        ³ ³                            ³rxdle = 0                 ³Store     ³
  393. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  394. ³Store   ³1³format == 0                 ³Garbage                   ³NextByte  ³
  395. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  396. ³        ³2³pktlen >= maximum           ³Pkt too long / lost PKTEND³Reset     ³
  397. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  398. ³        ³3³else (fmt > 0 & len < max)  ³Append c to databuffer    ³NextByte  ³
  399. ³        ³ ³                            ³increment pktlen          ³          ³
  400. ÃÄÄÄÄÄÄÄÄÅÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  401. ³PktStart³                              ³rxdle = 0                 ³NextByte  ³
  402. ³        ³                              ³pktlen = 0                ³          ³
  403. ÃÄÄÄÄÄÄÄÄÅÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  404. ³PktEnd  ³1³format == 0                 ³End without start, garbage³Reset     ³
  405. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  406. ³        ³2³format == BINPKT            ³(No more decoding needed) ³CalcCRC   ³
  407. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  408. ³        ³3³format == HEXPKT            ³ok = Decode HEXPKT        ³CheckDec  ³
  409. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  410. ³        ³4³format == ASCPKT            ³ok = Decode ASCPKT        ³CheckDec  ³
  411. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  412. ³        ³5³format == UUEPKT            ³ok = Decode UUEPKT        ³CheckDec  ³
  413. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  414. ³CheckDec³1³ok (no errors during decode)³                          ³CalcCRC   ³
  415. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  416. ³        ³2³else (errors in decoding)   ³Bad encoding, ignore pkt  ³Reset     ³
  417. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  418. ³CalcCRC ³1³format != HEXPKT &          ³Calc CRC-32 over databuf  ³CheckCRC  ³
  419. ³        ³ ³CRC-32 allowed              ³ok = (crc == 0xdebb20e3)  ³          ³
  420. ³        ³ ³                            ³pktlen = pktlen - 4       ³          ³
  421. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  422. ³        ³2³else (HEXPKT or no CRC-32)  ³Calc CRC-16 over databuf  ³CheckCRC  ³
  423. ³        ³ ³                            ³ok = (crc == 0xf0b8)      ³          ³
  424. ³        ³ ³                            ³pktlen = pktlen - 2       ³          ³
  425. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  426. ³CheckCRC³1³ok (CRC matched magic)      ³pkttype = last byte of buf³Reset     ³
  427. ³        ³ ³                            ³pktlen = pktlen - 1       ³          ³
  428. ³        ³ ³                            ³Hand pkt to higher level  ³          ³
  429. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  430. ³        ³2³else (CRC check failed)     ³Bad CRC, ignore packet    ³Reset     ³
  431. ÀÄÄÄÄÄÄÄÄÁÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ
  432.  
  433.  
  434.  
  435.     BIN packet format
  436.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  437.     The binary packet format require an 8-bit data channel. If requested
  438.     by either side, one or more sets of control characters are escaped.
  439.     In this case, when one of these characters appears in an unframed
  440.     packet, a H_DLE is sent followed by the character XOR 0x40. The H_DLE
  441.     character itself is always transmitted in this fashion. On the
  442.     receiver side, if the character after a H_DLE is not one of the
  443.     packet format bytes, this character is decoded using XOR 0x40 again.
  444.  
  445.  
  446. BINPKT Escaping
  447. ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ¿
  448. ³State   ³Predicate(s)                  ³Action(s)                 ³Next state³
  449. ÃÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  450. ³Begin   ³                              ³txlastc = 0               ³NextByte  ³
  451. ÃÄÄÄÄÄÄÄÄÅÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  452. ³NextByte³1³No more bytes to process    ³                          ³Done      ³
  453. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  454. ³        ³2³Escape ctlchars with 8th set³n = c AND 0x7f (strip 8th)³Escape    ³
  455. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  456. ³        ³3³else (let 8 bit ctl through)³n = c                     ³Escape    ³
  457. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  458. ³Escape  ³1³n == H_DLE                  ³Output H_DLE              ³Output    ³
  459. ³        ³ ³                            ³c = c XOR 0x40            ³          ³
  460. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  461. ³        ³2³Escape XON/XOFF &           ³Output H_DLE              ³Output    ³
  462. ³        ³ ³n == XON or n == XOFF       ³c = c XOR 0x40            ³          ³
  463. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  464. ³        ³3³Escape Telenet &            ³Output H_DLE              ³Output    ³
  465. ³        ³ ³n == CR &                   ³c = c XOR 0x40            ³          ³
  466. ³        ³ ³txlasc == '@'               ³                          ³          ³
  467. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  468. ³        ³4³Escape all control chars &  ³Output H_DLE              ³Output    ³
  469. ³        ³ ³n < 32 or n == 127          ³c = c XOR 0x40            ³          ³
  470. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  471. ³        ³5³else (any other character)  ³                          ³Output    ³
  472. ÃÄÄÄÄÄÄÄÄÅÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  473. ³Output  ³                              ³Store c                   ³NextByte  ³
  474. ³        ³                              ³txlastc = c               ³          ³
  475. ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ
  476.  
  477.  
  478.  
  479.     HEX packet format
  480.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  481.     Supported by all implementations, this packet format is used in
  482.     worst-case situations and upon startup of a session when it is not
  483.     yet known what restrictions the line and the other side will place on
  484.     the link.
  485.  
  486.     Packet types always transmitted in HEX format are: START, INIT,
  487.     INITACK, IDLE, END.
  488.  
  489.     HEX format packets always use a 16-bit CRC.
  490.  
  491.     HEX packets assume a 7-bit link, escaping all control characters and
  492.     filtering all control characters upon receipt.
  493.  
  494.     ASCII characters in the range 128-255 (high bit set) are encoded by
  495.     first transmitting a backslash ('\') character (ASCII 92), followed
  496.     by the character in two lowercase hex-digits (bits 4-7 in first
  497.     digit, bits 0-3 in second).
  498.  
  499.     Uppercase hex-digits are not permitted.
  500.  
  501.     The backslash character itself is transmitted as two backslashes.
  502.  
  503.     ASCII characters in the range 0-31 and 127 (all control characters)
  504.     are escaped with H_DLE in the same fashion as in binary (BIN)
  505.     packets.
  506.  
  507.     Decoded  byte 1
  508.             ÚÄÄÄÄÄÄ¿
  509.             76543210
  510.             ÀÄÄÙÀÄÄÙ
  511.     Encoded  h1  h2
  512.  
  513.  
  514. HEXPKT Encoding/Escaping
  515. ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ¿
  516. ³State   ³Predicate(s)                  ³Action(s)                 ³Next state³
  517. ÃÄÄÄÄÄÄÄÄÅÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  518. ³NextByte³1³No more bytes to process    ³                          ³Done      ³
  519. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  520. ³        ³2³High bit of c set           ³Output \ (backslash)      ³          ³
  521. ³        ³ ³                            ³Output hexdigit(c bit 4-7)³          ³
  522. ³        ³ ³                            ³Output hexdigit(c bit 0-3)³          ³
  523. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  524. ³        ³3³c < 32 or c == 127          ³Output H_DLE              ³          ³
  525. ³        ³ ³                            ³Output (c XOR 0x40)       ³          ³
  526. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  527. ³        ³4³c == \ (backslash)          ³Output \ (backslash)      ³          ³
  528. ³        ³ ³                            ³Output \ (backslash)      ³          ³
  529. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  530. ³        ³5³else (any other character)  ³Output c                  ³          ³
  531. ÀÄÄÄÄÄÄÄÄÁÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ
  532.  
  533.  
  534. HEXPKT Decoding
  535. ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ¿
  536. ³State   ³Predicate(s)                  ³Action(s)                 ³Next state³
  537. ÃÄÄÄÄÄÄÄÄÅÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  538. ³NextByte³1³No more bytes to process    ³                          ³Done OK   ³
  539. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  540. ³        ³2³c == \ (backslash)          ³                          ³Escape    ³
  541. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  542. ³        ³3³else (any other character)  ³Output c                  ³Escape    ³
  543. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  544. ³Escape  ³1³No more bytes to process    ³Premature end of data     ³Error     ³
  545. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  546. ³        ³2³c == \ (backslash)          ³Output \ (backslash)      ³          ³
  547. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  548. ³        ³3³c == lowercase hexdigit     ³Save c, move ptr to next  ³NextHex   ³
  549. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  550. ³        ³4³else (all other characters) ³Invalid character         ³Error     ³
  551. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  552. ³NextHex ³1³No more bytes to process    ³Premature end of data     ³Error     ³
  553. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  554. ³        ³2³c == lowercase hexdigit     ³Output (1st << 4 OR 2nd)  ³NextByte  ³
  555. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  556. ³        ³3³else (all other characters) ³Invalid character         ³Error     ³
  557. ÀÄÄÄÄÄÄÄÄÁÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ
  558.  
  559.  
  560.     ASC packet format
  561.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  562.     Support of this packet format is optional and signalled in the INIT
  563.     packet with the ASC flag in the "Supported options" field. 8-bit data
  564.     is transformed into 7-bit data by a simple shift operation. Each byte
  565.     is inserted at the top of a shift register, the lower seven bits are
  566.     moved out. So seven 8-bit bytes are encoded into eight 7-bit
  567.     characters.
  568.  
  569.     The end of the packet is padded by a maximum of six bits of 0 to make
  570.     the number of bits a multiple of seven and thereby creating
  571.     complete characters (so the receiver stops decoding when there are
  572.     less than seven bits left). The output can contain control
  573.     characters, so if escaping of these characters is required, this is
  574.     done as in BIN packets using the H_DLE method.
  575.  
  576.  
  577.     Decoded  byte 7  byte 6  byte 5  byte 4  byte 3  byte 2  byte 1
  578.             ÚÄÄÄÄÄÄ¿ÚÄÄÄÄÄÄ¿ÚÄÄÄÄÄÄ¿ÚÄÄÄÄÄÄ¿ÚÄÄÄÄÄÄ¿ÚÄÄÄÄÄÄ¿ÚÄÄÄÄÄÄ¿
  579.             76543210765432107654321076543210765432107654321076543210
  580.             ÀÄÄÄÄÄÙÀÄÄÄÄÄÙÀÄÄÄÄÄÙÀÄÄÄÄÄÙÀÄÄÄÄÄÙÀÄÄÄÄÄÙÀÄÄÄÄÄÙÀÄÄÄÄÄÙ
  581.     Encoded   c8     c7      c6    c5     c4     c3     c2     c1
  582.  
  583.  
  584. ASCPKT Encoding/Escaping
  585. ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ¿
  586. ³State   ³Predicate(s)                  ³Action(s)                 ³Next state³
  587. ÃÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  588. ³Reset   ³                              ³n = 0 (16 bit wide!)      ³NextByte  ³
  589. ³        ³                              ³bitshift = 0              ³          ³
  590. ÃÄÄÄÄÄÄÄÄÅÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  591. ³NextByte³1³No more bytes to process    ³                          ³Flush     ³
  592. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  593. ³        ³2³else (more bytes to process)³n = n OR (c << bitshift)  ³Shift     ³
  594. ³        ³ ³                            ³BINPKT escape (n & 0x7f)  ³          ³
  595. ³        ³ ³                            ³n = n >> 7                ³          ³
  596. ³        ³ ³                            ³increment bitshift        ³          ³
  597. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  598. ³Shift   ³1³bitshift == 7               ³BINPKT escape (n & 0x7f)  ³Reset     ³
  599. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  600. ³        ³2³else (bitshift < 7)         ³                          ³NextByte  ³
  601. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  602. ³Flush   ³1³bitshift > 0                ³BINPKT escape (n & 0x7f)  ³Done      ³
  603. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  604. ³        ³2³else (bitshift == 0)        ³                          ³Done      ³
  605. ÀÄÄÄÄÄÄÄÄÁÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ
  606.  
  607. ASCPKT Decoding
  608. ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ¿
  609. ³State   ³Predicate(s)                  ³Action(s)                 ³Next state³
  610. ÃÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  611. ³Begin   ³                              ³n = 0 (16 bit wide!)      ³NextByte  ³
  612. ³        ³                              ³bitshift = 0              ³          ³
  613. ÃÄÄÄÄÄÄÄÄÅÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  614. ³NextByte³1³No more bytes to process    ³                          ³Done OK   ³
  615. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  616. ³        ³2³else (more bytes to process)³c = c AND 0x7f            ³Shift     ³
  617. ³        ³ ³                            ³n = n OR (c << bitshift)  ³          ³
  618. ³        ³ ³                            ³bitshift = bitshift + 7   ³          ³
  619. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  620. ³Shift   ³1³bitshift >= 8               ³Output (n AND 0xff)       ³NextByte  ³
  621. ³        ³ ³                            ³n = n >> 8                ³          ³
  622. ³        ³ ³                            ³bitshift = bitshift - 8   ³          ³
  623. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  624. ³        ³2³else (bitshift < 8)         ³                          ³NextByte  ³
  625. ÀÄÄÄÄÄÄÄÄÁÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ
  626.  
  627.  
  628.  
  629.     UUE packet format
  630.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  631.     Support of this packet format is optional and signalled in the INIT
  632.     packet with the UUE flag in the "Supported options" field. The 8-bit
  633.     data is transformed into printable ASCII using the UUENCODE
  634.     algorithm. Three 8-bit bytes are encoded into four printable ASCII
  635.     characters. This done by taking the bottom six bits left and adding
  636.     '!' (ASCII 33) to move this character value into printable ASCII
  637.     range.
  638.  
  639.     The end of the packet is padded by a maximum of five bits of 0 to
  640.     make the number of bits a multiple of six and thereby creating 
  641.     complete characters (so the receiver stops decoding when there are
  642.     less than six bits left). The output of this coding scheme does not
  643.     need any further escaping before transmission.
  644.  
  645.     Decoded  byte 3  byte 2  byte 1
  646.             ÚÄÄÄÄÄÄ¿ÚÄÄÄÄÄÄ¿ÚÄÄÄÄÄÄ¿
  647.             765432107654321076543210
  648.             ÀÄÄÄÄÙÀÄÄÄÄÙÀÄÄÄÄÙÀÄÄÄÄÙ
  649.     Encoded   c4    c3    c2    c1
  650.  
  651.  
  652. UUEPKT Encoding
  653. ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ¿
  654. ³State   ³Predicate(s)                  ³Action(s)                 ³Next state³
  655. ÃÄÄÄÄÄÄÄÄÅÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  656. ³NextByte³1³Less than three bytes left  ³                          ³Flush     ³
  657. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  658. ³        ³2³else (three or more left)   ³UUE(in[0]>>2)             ³          ³
  659. ³        ³ ³                            ³UUE(in[0]<<4 OR in[1]>>4) ³          ³
  660. ³        ³ ³                            ³UUE(in[1]<<2 OR in[2]>>6) ³          ³
  661. ³        ³ ³                            ³UUE(in[2])                ³          ³
  662. ³        ³ ³                            ³(UUE: (c AND 0x3f) + '!') ³          ³
  663. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  664. ³Flush   ³1³No more bytes left          ³                          ³Done      ³
  665. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  666. ³        ³2³One byte left               ³UUE(in[0]>>2)             ³Done      ³
  667. ³        ³ ³                            ³UUE(in[0]<<4)             ³          ³
  668. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  669. ³        ³3³Two bytes left              ³UUE(in[0]>>2)             ³Done      ³
  670. ³        ³ ³                            ³UUE(in[0]<<4 OR in[1]>>4) ³          ³
  671. ³        ³ ³                            ³UUE(in[1]<<2)             ³          ³
  672. ÀÄÄÄÄÄÄÄÄÁÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ
  673.  
  674. UUEPKT Decoding
  675. ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ¿
  676. ³State   ³Predicate(s)                  ³Action(s)                 ³Next state³
  677. ÃÄÄÄÄÄÄÄÄÅÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  678. ³NextByte³1³Less than four bytes left   ³                          ³Flush     ³
  679. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  680. ³        ³2³else (four or more left) &  ³UD(i[0])<<2 OR UD(i[1])>>4³          ³
  681. ³        ³ ³(c AND 0x7f) is in UUE range³UD(i[1])<<4 OR UD(i[2])>>2³          ³
  682. ³        ³ ³                            ³UD(i[2])<<6 OR UD(i[3])   ³          ³
  683. ³        ³ ³                            ³(UD: (c - '!') AND 0x3f)  ³          ³
  684. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  685. ³        ³3³else (all other characters) ³Invalid character(s)      ³Error     ³
  686. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  687. ³Flush   ³1³No bytes left or            ³                          ³Done OK   ³
  688. ³        ³ ³Less than two bytes left    ³                          ³          ³
  689. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  690. ³        ³2³Two bytes left &            ³UD(i[0])<<2 OR UD(i[1])>>4³Done OK   ³
  691. ³        ³ ³(c AND 0x7f) is in UUE range³                          ³          ³
  692. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  693. ³        ³3³Three bytes left &          ³UD(i[0])<<2 OR UD(i[1])>>4³Done OK   ³
  694. ³        ³ ³(c AND 0x7f) is in UUE range³UD(i[1])<<4 OR UD(i[2])>>2³          ³
  695. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  696. ³        ³4³else (all other characters) ³Invalid character(s)      ³Error     ³
  697. ÀÄÄÄÄÄÄÄÄÁÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ
  698.  
  699.  
  700.  
  701.     START packet                                             (HEX format)
  702.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  703.     This packet is sent to tell the remote to initiate a HYDRA session.
  704.  
  705.     The complete framed packet as transmitted looks like:
  706.  
  707.         ASCII values   24    99  65  92 102  53  92  97  51    24    97
  708.                     ÚÄÄÄÄÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄ¿
  709.         Characters  ³ H_DLE ³ c ³ A ³ \ ³ f ³ 5 ³ \ ³ a ³ 3 ³ H_DLE ³ a ³
  710.                     ÀÄÄÄÄÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÙ
  711.  
  712.     Applications may scan for this sequence to automatically start HYDRA
  713.     when the remote transmits this packet (AutoStart). Prior to the START
  714.     packet, a special string is transmitted to enable remote starting
  715.     from a command prompt, hydra<CR> (the word hydra in lowercase):
  716.  
  717.         ASCII values 104 121 100 114  97  13
  718.                     ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÄ¿
  719.         Characters  ³ h ³ y ³ d ³ r ³ a ³ CR ³
  720.                     ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÄÙ
  721.  
  722.     The special string combined with the START packet is transmitted at
  723.     five second intervals until either a START or INIT packet is received
  724.     from the remote, or the maximum number of retries is reached. Any
  725.     other packet types received in this stage must be ignored as they
  726.     could be remains of a previous session.
  727.  
  728.  
  729.     INIT packet                                              (HEX format)
  730.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  731.     The INIT packet contains file transfer session options. The remote
  732.     acknowledges this packet by returning an INITACK packet.
  733.  
  734.  
  735.                               INIT packet data
  736.  
  737.                  ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  738.                  ~ Application ID string, NUL terminated ~
  739.                  ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  740.                  ~ Supported options, NUL terminated     ~
  741.                  ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  742.                  ~ Desired options, NUL terminated       ~
  743.                  ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  744.                  ³ Desired transmitter window size or 0  ³
  745.                  ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  746.                  ³ Desired receiver window size or 0     ³
  747.                  ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  748.                  ~ Other general options, NUL terminated ~
  749.                  ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  750.                  ~ Packet prefix string, NUL terminated  ~
  751.                  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  752.  
  753.     The application ID string contains a printable ASCII string with the
  754.     document revision date, product name, product revision number, and
  755.     optionally the product serial number. The format of the string is:
  756.  
  757.         <RevDate><ProductName><,><ProductRevision>[<,><ProductSerial#>]
  758.  
  759.     RevDate is the UNIX timestamp (the hour, minute, and second portion
  760.     is assumed to be zero), in hexadecimal notation, of the HYDRA
  761.     document that the application is supposed to support. None of the
  762.     following three fields should exceed thirty characters in length and
  763.     must not contain any control characters (ASCII 0-31) or the comma
  764.     character (ASCII 44). The field separator is a comma (ASCII 44)
  765.     character.
  766.  
  767.     Capability flags
  768.  
  769.         XON        Escape <XON> and <XOFF> characters.
  770.         TLN        Escape the <CR>@<CR> sequence (Telenet escape).
  771.         CTL        Escape ASCII characters 0-31 and 127.
  772.         HIC        Escape above three with high bit set.
  773.         HI8        Escape ASCII characters 128-255 and strip the high bit.
  774.         BRK        Can transmit a break signal.
  775.         ASC        Can handle ASC packets.
  776.         UUE        Can handle UUE packets.
  777.         C32        Can receive packets with 32-bit CRC error detection.
  778.         DEV        Can receive device packets.
  779.         FPT        Can receive filenames with paths.
  780.  
  781.     Capability flags are always three characters long, in uppercase, and
  782.     seperated by a comma character (ASCII 44). Please note that the first
  783.     five flags must be supported by all applications that implement the
  784.     HYDRA specifications.
  785.  
  786.     The "Supported options" string contain the capability flags of the
  787.     options that the application support. The "Desired options" string
  788.     contain the capability flags of the options that the application
  789.     would like to use/enable for the session. Some flags do not have to
  790.     be specified in both strings. E.g. if the C32 flag is present in the
  791.     "Supported options" string and the remote system indicates support
  792.     for the same flag, 32-bit CRC error detection will be used. An
  793.     application may not ask for an option it does not support.
  794.  
  795.     Escaping certain characters or bits also means filtering any
  796.     occurrence of them in the incoming data stream. At the start of a
  797.     session, it is assumed that the first five capability flags are in
  798.     effect, i.e. the high bit is stripped off every received character
  799.     and all control characters are filtered out.
  800.  
  801.     The "Desired transmitter/receiver window size" fields are long
  802.     integers expressed in hexadecimal notation. With these options each
  803.     side tells the other to use window management of the requested size
  804.     when transmitting file data, instead of using full streaming (0).
  805.     The window setting is completely seperate for both directions.
  806.     If one side requests a smaller window size than the other, that
  807.     smaller size will be used for that direction; also, a window of any
  808.     size takes precedence over no window (0).
  809.     Please note that the terms 'transmitter' and 'receiver' used for the
  810.     fields in the INIT packet are from the view of the side transmitting
  811.     that packet, so the other side should merge the 'transmitter' window
  812.     field from the received INIT packet with its own 'receiver' window
  813.     field.
  814.  
  815.     The "General options" string currently has no other fields than
  816.     "Desired tx/rx window size"; the string is NUL terminated.
  817.  
  818.     The packet prefix string is normally empty, but may be provided by
  819.     the remote if required. The maximum length of a packet prefix string
  820.     is 30 characters. All characters should be transmitted as specified,
  821.     with the following exceptions:
  822.  
  823.     
  824.                 Table of special packet prefix string chars
  825.  
  826.                ÚÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  827.                ³ASCII³Description                           ³
  828.                ÃÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  829.                ³ 221 ³Transmit a break signal for one second³
  830.                ³ 222 ³Delay one second before next character³
  831.                ³ 223 ³Transmit a NUL (ASCII 0) character    ³
  832.                ÀÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  833.  
  834.  
  835.     INITACK packet                                           (HEX format)
  836.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  837.     The INITACK packet is used to acknowledge the receipt of the remote's
  838.     INIT packet.
  839.  
  840.     Duplicate INIT packets should be acknowledged too, as the remote may
  841.     have missed previous INITACK packets; the reception of such a
  842.     duplicate packet should not however reset the braindead timer, as it
  843.     does not mean a change of state and is not actual file data.
  844.  
  845.  
  846.     FINFO packet
  847.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  848.     File information packet, sent to notify the remote that another file
  849.     is to be transmitted, or to signal end of batch. After the FINFO
  850.     packet has been transmitted, the timer is set to the normal timeout
  851.     value. The sender then waits for an FINFOACK packet from the remote
  852.     or for the timer to expire. In the event of a timeout, the transmit/
  853.     wait sequence is repeated with half the normal timeout value until
  854.     the maximum number of retries has been reached.
  855.  
  856.  
  857.                               FINFO packet data
  858.                    ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  859.                    ~ File information, NUL terminated    ~
  860.                    ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  861.  
  862.  
  863.                    File information        End of batch
  864.                   ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿   ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  865.                   ³ Timestamp or 0  ³   ³       NUL       ³ 
  866.                   ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 
  867.                   ³ Filesize or 0   ³
  868.                   ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  869.                   ³ Reserved (0)    ³
  870.                   ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  871.                   ³ Transaction #   ³
  872.                   ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  873.                   ³ File count or 0 ³
  874.                   ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  875.                   ~ Short filename  ~
  876.                   ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  877.                   ~ Real filename   ~
  878.                   ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  879.                   ³     NUL         ³
  880.                   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  881.                      
  882.     End of batch is signalled by an empty string (only the terminating
  883.     NUL).
  884.  
  885.     The first five fields are long integers expressed in hexadecimal
  886.     notation.
  887.  
  888.     Timestamp is a UNIX timestamp representing the creation time of the
  889.     file. If the creation time is not known, this is zero.
  890.  
  891.     Filesize is the size of the file in bytes. If the size of the file is
  892.     not known, this is zero. This field should not be used as an exact
  893.     measure of the size of the file. It is safe to assume that you should
  894.     not receive less data than specified in this field, but the file may
  895.     grow while it is being transferred (e.g. the result of a background
  896.     process).
  897.  
  898.     Transaction # is a unique number for each set of files being sent
  899.     during the session. This is primarily used to allow the receiving
  900.     application to group several files together and store them in
  901.     specific directories as a result of automated file requests. If the
  902.     file being sent is not a result of an automated file request, this
  903.     field must be set to zero.
  904.  
  905.     File count is the session file counter. For the first file in a
  906.     session, this field contains the total number of files to be sent
  907.     during the session; for subsequent files, it contains the file number
  908.     in the session, starting with two (2). If the total number of files
  909.     is not known, this field contains zero for all files.
  910.  
  911.     The first filename field must be specified in lowercase characters.
  912.     It must conform to MS-DOS filename conventions and not exceed 12
  913.     characters in length (excluding the terminating NUL character). The
  914.     second field, real filename, is the actual filename on the sending
  915.     system. If this field is not present, the short filename field is
  916.     used.
  917.  
  918.     No directory paths may be specified in the short filename. Directory
  919.     paths may be specified in the real filename field if the "Desired
  920.     options" of the receiver contains FPT. If the real filename field
  921.     contains a path, it may include any ASCII character in the range 32
  922.     (0x20) through 255 (0xff) with \ characters translated to /. A drive
  923.     specifier may be present in the <Drive>: (e.g. c:) format. If both
  924.     the short and real filename fields are present, they are separated
  925.     by a NUL character. There is never more than one NUL character
  926.     terminating the packet.
  927.     
  928.  
  929.     FINFOACK packet
  930.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  931.     Sent in response to an FINFO packet. If the FINFO packet contained
  932.     file information, the FINFOACK packet is also used to instruct the
  933.     remote how to proceed with the transfer.
  934.  
  935.  
  936.                             FINFOACK packet data
  937.                  ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  938.                  ³ Long file offset, special code, or 0  ³
  939.                  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  940.  
  941.     The only data in this packet is a long integer. In response to an
  942.     an end of batch FINFO packet, the file offset is set to zero (0). In
  943.     all other cases, file offset is one of the following:
  944.  
  945.  
  946.                        File offsets and special values
  947.            ÚÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  948.            ³Offset³Description                                   ³
  949.            ÃÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  950.            ³ >=0  ³Seek to specified offset and start sending (1)³
  951.            ³  -1  ³Already have file                          (2)³
  952.            ³  -2  ³Send file during another batch (not now)      ³
  953.            ÀÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  954.  
  955.     (1) This can only be something other than zero if the FINFO packet
  956.         specified a filesize other than zero (i.e. the size of the file
  957.         is known to the receiver).
  958.  
  959.     (2) The sending application should consider the file as having been
  960.         sent successfully. This is primarily used to prevent duplicate
  961.         files from being transmitted.
  962.  
  963.  
  964.     DATA packet
  965.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  966.     Packet containing actual file data.
  967.  
  968.  
  969.                                   DATA packet
  970.                   ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  971.                   ³ Long file offset of file data block     ³
  972.                   ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  973.                   ~ Variable length data block 0-2048 bytes ~
  974.                   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  975.  
  976.     If the file offset corresponds with what is expected by the receiver,
  977.     the data block is saved and the file position increased accordingly.
  978.     If the file offset is not correct, DATA packets may have been lost or
  979.     failed the CRC check. Bad packets are ignored because it is not
  980.     certain that the bad packet was an actual DATA packet and not some
  981.     other type of packet. The file offset comparison is therefore the
  982.     only way to find out about lost or bad data.
  983.  
  984.     When a bad data packet is detected, an RPOS packet is transmitted by
  985.     the receiver to force the sender to seek to the desired file offset
  986.     and resume transmission from it. After transmitting the RPOS packet,
  987.     the receiver initializes a timer and continues to monitor received
  988.     DATA packets while comparing their file offset with its desired
  989.     offset.
  990.  
  991.     If the offset of a newly received DATA packet is greater than the
  992.     offset received in the last DATA packet prior to transmitting the
  993.     RPOS packet, the sender has not yet seen the RPOS packet, or the
  994.     DATA packet was already in the data stream when the RPOS packet was
  995.     transmitted.
  996.  
  997.     If the received offset matches the requested offset, the transfer is
  998.     resumed, otherwise, a new RPOS packet is transmitted by the receiver
  999.     and the timer restarted.
  1000.  
  1001.     If the timer expires, another RPOS packet is transmitted by the
  1002.     receiver. This is repeated until the maximum number of retries has
  1003.     been reached.
  1004.  
  1005.     If the receiver encounters more missing or invalid DATA packets at
  1006.     the same offset than it finds acceptable and it is not the originator
  1007.     of the session, it may decide to revert to a one-way transfer and
  1008.     wait with sending the remainder of its own files until the remote has
  1009.     transmitted its end of batch signal. It is possible that some hard-
  1010.     ware is not capable or well suited for a bi-directional file transfer
  1011.     involving large volumes of data (see description of the IDLE packet).
  1012.  
  1013.  
  1014.     DATAACK packet
  1015.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  1016.     Transmitted by the receiver with its current file offset after
  1017.     receiving a valid DATA packet.
  1018.  
  1019.  
  1020.                               DATAACK packet data
  1021.                           ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  1022.                           ³    Long file offset    ³
  1023.                           ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  1024.  
  1025.     This packet is only transmitted if there is a window in operation
  1026.     for that direction (selected in the INIT stage of the session), in
  1027.     which case the sender uses the DATAACK file offsets to manage its
  1028.     transmit window. If the sender's file offset is greater than or equal
  1029.     to the last DATAACK offset received plus the window size, no more
  1030.     data is transmitted by the sender until a DATAACK packet is received
  1031.     which allows the sender to proceed without exceeding the window size.
  1032.  
  1033.     While waiting for the DATAACK packet, the sender checks its timer
  1034.     and retry counter. If the timer expires before a valid DATAACK packet
  1035.     is received, the next DATA packet is transmitted, the retry counter
  1036.     incremented, and the timer restarted with half the normal timeout.
  1037.     This system ensures that the two sides do not end up waiting for
  1038.     each other in case packets are lost; the receiver will respond with
  1039.     either a DATAACK or RPOS packet. Receipt of a DATAACK packet does not
  1040.     reset the braindead timer.
  1041.  
  1042.     There are two windowing systems the receiver can use: sliding window
  1043.     or segmented streaming.
  1044.  
  1045.     If the receiver is capable of simultaneous serial and disk I/O, it
  1046.     will transmit a DATAACK packet for every received DATA packet, or
  1047.     every few DATA packets if it wants to be more economical with line
  1048.     capacity.
  1049.     Sliding window transmission is just a method of keeping the runahaid
  1050.     of the transmitter within reasonable limits (for sattelite or network
  1051.     links with long delays), thereby allowing for faster error recovery.
  1052.     Because of Hydra's tolerancy to delays and method of error recovery,
  1053.     sliding windows transmission is not normally required and full
  1054.     streaming can be used.
  1055.  
  1056.     If however the receiver is not capable of simultaneous serial and
  1057.     disk I/O, it will will process received DATA packets until the window
  1058.     size is reached (or slightly exceeded), write the received packets to
  1059.     disk, and then transmit one DATAACK packet to signal that it can
  1060.     receive the next segment of data.
  1061.  
  1062.     If the sender cannot handle simultaneous serial and disk I/O, it can
  1063.     apply the segmented streaming technique for reading data segments of
  1064.     the negotiated window size from disk.
  1065.  
  1066.  
  1067.     RPOS packet
  1068.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  1069.     Transmitted by the receiver to force the sender to seek to a specific
  1070.     position in the file and resume the transfer (as described above).
  1071.  
  1072.     The RPOS packet is also used by the receiver to skip a file once the
  1073.     transfer has been initiated. This is done by transmitting a RPOS
  1074.     packet with -2 as the desired offset and then waiting for a EOF
  1075.     packet with the same offset (-2). Once the EOF packet is received,
  1076.     the receiver responds to it by transmitting a EOFACK packet and then
  1077.     proceeds to wait for the next FINFO packet.
  1078.  
  1079.  
  1080.                           RPOS packet dependent data
  1081.                   ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  1082.                   ³ Long file offset                       ³
  1083.                   ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  1084.                   ³ Desired datablock size (word, 64-2048) ³
  1085.                   ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  1086.                   ³ Long RPOS packet ID                    ³
  1087.                   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  1088.  
  1089.  
  1090.                                  File offsets 
  1091.              ÚÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  1092.              ³Offset³Description                                ³
  1093.              ÃÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  1094.              ³ >=0  ³Seek to specified offset and resume sending³
  1095.              ³  -2  ³Send file during another batch (not now)   ³
  1096.              ÀÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  1097.  
  1098.     The desired data blocksize field tells the sender what blocksize
  1099.     to use when it resumes transmitting from the specified file offset.
  1100.  
  1101.     Each new RPOS packet should be given a different packet ID. This
  1102.     allows the sender to identify and ignore duplicate RPOS packets.
  1103.     The ID need not be sequential, but it must not have the same value as
  1104.     any other RPOS packet sent during the transmission of the same file.
  1105.     A RPOS ID value of zero (0) is not permitted. The same ID value is
  1106.     only used when sending multiple RPOS packets due to an expired RPOS
  1107.     packet timer as described above (DATA packet).
  1108.  
  1109.  
  1110.     EOF packet
  1111.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  1112.     Indicates that the end of the file has been reached by the sender.
  1113.     The packet is transmitted after the last DATA packet with file data.
  1114.     The EOF packet only contains one field which holds the current file
  1115.     offset of the sender (i.e. the actual size of the file).
  1116.  
  1117.     After the EOF packet has been transmitted, the timer is set to the
  1118.     normal timeout value. The sender then waits for an EOFACK packet
  1119.     from the remote or for the timer to expire. In the event of a
  1120.     timeout, the transmit/wait sequence is repeated with half the normal
  1121.     timeout value until the maximum number of retries has been reached.
  1122.  
  1123.     In the event that the receiver requests to skip the file by
  1124.     transmitting a RPOS(-2) packet (see RPOS packet), the EOF packet
  1125.     contains the same value (-2). If the sender wants to skip the file
  1126.     currently being transmitted, it issues an EOF packet with -2 as the
  1127.     offset value.
  1128.  
  1129.     EOF packets with an incorrect offset should be treated by the
  1130.     receiver as if it was an incorrect DATA packet (i.e. transmitting an
  1131.     RPOS packet). Accepted EOF packets are acknowledged by transmitting
  1132.     an EOFACK packet.
  1133.  
  1134.  
  1135.                                 EOF packet data
  1136.                      ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  1137.                      ³ Long file offset or special code ³
  1138.                      ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  1139.  
  1140.  
  1141.                          File offsets and special value
  1142.                ÚÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  1143.                ³Offset³Description                             ³
  1144.                ÃÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  1145.                ³ >=0  ³Final offset in file (size of file)     ³
  1146.                ³  -2  ³Send file during another batch (not now)³
  1147.                ÀÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  1148.  
  1149.  
  1150.     EOFACK packet
  1151.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  1152.     Transmitted in response to an accepted EOF packet. After transmitting
  1153.     this packet, the receiver waits for the FINFO packet of the next file
  1154.     or end of batch.
  1155.  
  1156.  
  1157.     END packet                                               (HEX format)
  1158.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  1159.     Once all files have been transmitted by both sides and no device
  1160.     packets remain to be transmitted, the end of session sequence is
  1161.     initiated. END packets are always sent in HEX format.
  1162.  
  1163.     Two END packets are transmitted and the transmit timer set to half
  1164.     the normal timeout. The application then waits for an END packet from
  1165.     the remote or for the transmit timer to expire. In the event of a
  1166.     timeout, the transmit/wait sequence is repeated until the maximum
  1167.     number of retries has been reached. At this point, the HYDRA session
  1168.     may be considered to be successful as both batches were completed.
  1169.  
  1170.     If an END packet is received before timeout, another three (3) END
  1171.     packets are transmitted and the protocol exits. Both sides need to
  1172.     transmit END packets and receive at least one from the remote.
  1173.  
  1174.  
  1175.     IDLE packet                                              (HEX format)
  1176.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  1177.     The IDLE packet is used to let the remote know that the application
  1178.     is still alive. This is only applicable in uni-directional transfer
  1179.     mode to let the remote know that your application is still alive when
  1180.     it is receiving files, and after having transmitted an end of batch
  1181.     signal to the remote and not having any more files to send for the
  1182.     remainder of the session.
  1183.  
  1184.     When applicable, the IDLE packet is transmitted every 20 seconds. The
  1185.     remote resets its braindead timer upon receipt of an IDLE packet. If
  1186.     an application receives an IDLE packet while it is in a state where
  1187.     it is transmitting IDLE packets to the remote, something is wrong.
  1188.     This could occur if both sides have accidentally switched to one-way
  1189.     mode waiting for the remote to finish its batch. In this situation,
  1190.     one-way should be disabled to prevent a complete deadlock. Note that
  1191.     if both sides have finished their batch, the end of session sequence
  1192.     (see END packet) should be initiated.
  1193.  
  1194.  
  1195.     DEVDATA packet
  1196.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  1197.     Support for the DEVDATA and DEVDACK packets is optional and indicated
  1198.     in the INIT packet with the DEV flag in the "Supported options"
  1199.     field. The ID value is a long, different for each new device data
  1200.     packet sent. A value of zero (0) is not permitted.
  1201.  
  1202.     Only one DEVDATA packet may be transmitted at a time; the side
  1203.     issuing it then waits either for a timeout of the device transmit
  1204.     timer, or for a DEVDACK packet with the correct ID value to be
  1205.     received from the remote. If the timer expires before a correct
  1206.     DEVDACK packet is received, the DEVDATA packet is again transmitted,
  1207.     and the nnumber of device transmit retries incremented. If the
  1208.     maximum number of retries is reached, the HYDRA session is aborted;
  1209.     apparently the other is not functioning properly, or data is not
  1210.     getting through. In either case, the normal operation of the
  1211.     protocol (transferring files) will also fail.
  1212.  
  1213.     The name of the device to which the data is addressed is transmitted
  1214.     as an uppercase fixed-length three character NUL terminated string.
  1215.     There are two pre-defined device names as described below. If an
  1216.     unknown device name is specified, or a duplicate DEVDATA packet is
  1217.     received (one with the same ID value as a previously received and
  1218.     acknowledged DEVDATA packet), the packet is simply discarded after
  1219.     transmitting a DEVDACK packet with the corresponding ID value.
  1220.  
  1221.     DEVDATA and DEVDACK packets do not reset the braindead timer. They
  1222.     operate independently from the normal protocol. Device packets may
  1223.     only be transmitted after the initialization sequence, and before
  1224.     both sides have completed their batch. If a DEVDATA packet has not
  1225.     yet been acknowledged, the end of session sequence is delayed until
  1226.     a DEVDACK packet has been sent in response.
  1227.  
  1228.  
  1229.                        DEVDATA packet dependent data
  1230.            ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  1231.            ³ Long DEVDATA packet ID value                     ³
  1232.            ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  1233.            ³ 3 character uppercase device name, NUL terminated³
  1234.            ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  1235.            ~ Variable length device data block (0-2048)       ~
  1236.            ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  1237.  
  1238.  
  1239.                            Predefined device names
  1240.                 ÚÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  1241.                 ³Dev³Description                          ³
  1242.                 ÃÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  1243.                 ³MSG³Print data in protocol message window³
  1244.                 ³CON³Print data to user console           ³
  1245.                 ÀÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  1246.  
  1247.     The MSG device may be used to notify the remote of protocol-specific
  1248.     issues, i.e. "One-way transfer mode". Such messages may be logged,
  1249.     but should not be considered to be machine-readable.
  1250.  
  1251.     The CON device may be used to implement a "chat" or conversation
  1252.     feature. This is a special case in which a session *can* be prolonged
  1253.     after end of batch, but not against the remote's will.
  1254.     While chat is enabled, there is no transition from the REND to the
  1255.     END transmitter state. When a CON device packet is transmitted in
  1256.     chat mode and the txstate is REND, the own braindead timer is reset.
  1257.     If the other side does initiate the end sequence by sending an END
  1258.     packet, the chat mode is immediately terminated and the session ended
  1259.     in a clean manner. If one side does not want to (continue) chat, and
  1260.     the other side does not comply, the one side will abort after a
  1261.     braindead timeout, so this chat system does not mean a security flaw.
  1262.     Each side is responsible for keeping the session going on his end
  1263.     until its own user has finished chatting. It is suggested that the
  1264.     software apply a timeout of say 1 minute to keyboard input, ending
  1265.     the chat automatically if the user stops typing but does not exit
  1266.     chat mode. Also, the chat mode should be initiated with a special key
  1267.     so that it can not erronously be started or prolonged.
  1268.  
  1269.  
  1270.     DEVDACK packet
  1271.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  1272.     Transmitted in response to a DEVDATA packet. The device data ID value
  1273.     must correspond to the ID of the previously received DEVDATA packet.
  1274.  
  1275.  
  1276.                               DEVDACK packet data
  1277.                          ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  1278.                          ³ Long device data ID value ³
  1279.                          ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  1280.  
  1281.  
  1282.  
  1283. DEVICE sender (devtxstate HTD_...)
  1284. ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ¿
  1285. ³State   ³Predicate(s)                  ³Action(s)                 ³Next state³
  1286. ÃÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1287. ³Begin   ³                              ³devtxid = 0               ³DONE      ³
  1288. ³        ³                              ³reset devtxtimer          ³          ³
  1289. ÃÄÄÄÄÄÄÄÄÅÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1290. ³DONE    ³1³wish to send device data &  ³increase devtxid          ³DATA      ³
  1291. ³        ³ ³other side allows DEV pkts  ³devtxretries = 0          ³          ³
  1292. ³        ³ ³                            ³reset devtxtimer          ³          ³
  1293. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1294. ³        ³2³wish to send device data &  ³Tell calling function     ³          ³
  1295. ³        ³ ³other doesn't allow DEV pkts³it's not on...            ³          ³
  1296. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1297. ³DATA    ³1³devtxretries == 10          ³Report too many errors    ³Abort     ³
  1298. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1299. ³        ³2³else (devtxretries < 10)    ³txpkt DEVDATA(id,dev,data)³DACK      ³
  1300. ³        ³ ³                            ³devtxtimer = timeout      ³          ³
  1301. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1302. ³DACK    ³1³rxpkt DACK &                ³reset devtxtimer          ³DONE      ³
  1303. ³        ³ ³DACK(id) == devtxid         ³                          ³          ³
  1304. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1305. ³        ³2³devtxtimer expired          ³Report devtx timeout      ³DATA      ³
  1306. ³        ³ ³                            ³increase devtxretries     ³          ³
  1307. ÀÄÄÄÄÄÄÄÄÁÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ
  1308.  
  1309. DEVICE RECEIVER
  1310. ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ¿
  1311. ³State   ³Predicate(s)                  ³Action(s)                 ³Next state³
  1312. ÃÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1313. ³Begin   ³                              ³devrxid = 0               ³DONE      ³
  1314. ÃÄÄÄÄÄÄÄÄÅÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1315. ³DONE    ³1³rxpkt DEVDATA               ³txpkt DEVDACK(id)         ³CheckID   ³
  1316. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1317. ³CheckID ³1³DEVDATA(id) != devrxid      ³devrxid = DEVDATA(id)     ³Process   ³
  1318. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1319. ³        ³2³else (apparent duplicate)   ³                          ³DONE      ³
  1320. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1321. ³Process ³1³DEVDATA(dev) == MSG         ³Print protocol message    ³DONE      ³
  1322. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1323. ³        ³2³DEVDATA(dev) == CON         ³Output to user console    ³DONE      ³
  1324. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1325. ³        ³3³DEVDATA(dev) == known&ok    ³Call processing routine   ³DONE      ³
  1326. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1327. ³        ³4³else (unknown/not-ok device)³One-way into bitbucket    ³DONE      ³
  1328. ÀÄÄÄÄÄÄÄÄÁÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ
  1329.  
  1330.  
  1331.     Packet length and data block size
  1332.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  1333.     The maximum length of a source data block (i.e. raw, non processed
  1334.     input file or device data) is 2048 bytes. The maximum allowed length
  1335.     of the packet data is 2048 + 8 = 2056 bytes. The eight bytes are to
  1336.     provide sufficient room for the additional fields in the DATA and
  1337.     DEVDATA packets. Packetizing adds an additional three to five bytes.
  1338.     The maximum length of a framed packet being transmitted can be three
  1339.     times the size of its source data depending on what type of encoding
  1340.     scheme is used (ASC, HEX, UUE, BIN). The minimum length of a data
  1341.     block is 64 bytes.
  1342.  
  1343.     The block size of DATA packets is based on the physical (DCE) link
  1344.     speed and is established as follows:
  1345.  
  1346.             ÚÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  1347.             ³DCE speed³Maximum block size³Starting block size³
  1348.             ÃÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  1349.             ³  300 bps³     256 bytes    ³     256 bytes     ³
  1350.             ³ 1200 bps³     512 bytes    ³     256 bytes     ³
  1351.             ³ 2400 bps³    1024 bytes    ³     512 bytes     ³
  1352.             ³>2400 bps³    2048 bytes    ³     512 bytes     ³
  1353.             ÀÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  1354.  
  1355.     The blocksize is initialized to the starting blocksize when a session
  1356.     is first started. After each kilobyte of file data transmitted, the
  1357.     blocksize is doubled until it reaches the maximum allowed blocksize.
  1358.  
  1359.     When the maximum allowed blocksize has been reached, the variable
  1360.     keeping track of how many bytes are needed to increase the blocksize
  1361.     is reset to zero.
  1362.  
  1363.     If a request for retransmission (RPOS packet) is received from the
  1364.     receiver, the blocksize is immediately set to that specified in the
  1365.     retransmission request. Every time this occurs, the number of bytes
  1366.     needed to double the blocksize is increased by 1024 with a maximum of
  1367.     of 8192 bytes. The end result is that more data has to be
  1368.     successfully transmitted before the blocksize is increased for each
  1369.     error that occurs.
  1370.  
  1371.     The length of a data block is dynamic and always in the range 0-2048
  1372.     bytes. A data block is never padded. If there is insufficient data
  1373.     to fill a block of the current blocksize, the blocksize is adjusted
  1374.     to the amount of remaining data.
  1375.  
  1376.     The blocksize logic is not reset between files in a session.
  1377.  
  1378.  
  1379.     Timers and retry counters
  1380.     ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
  1381.     Each process in the protocol (transmit, receive and device transmit)
  1382.     has its own timer and retry counter, and there is one overall
  1383.     braindead timer. Allowed are 10 tries, the braindead timeout is 120
  1384.     seconds, and the other timeouts are based on the speed of the line
  1385.     and the state of the protocol. It can be calculated as (40960/DCE
  1386.     rate), with a minimum of 10 seconds and a maximum of 60 seconds.
  1387.  
  1388.                      ÚÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ¿
  1389.                      ³DCE speed³Timeout   ³Half      ³
  1390.                      ÃÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1391.                      ³  300 bps³60 seconds³30 seconds³
  1392.                      ³ 1200 bps³34 seconds³17 seconds³
  1393.                      ³ 2400 bps³17 seconds³ 8 seconds³
  1394.                      ³>2400 bps³10 seconds³ 5 seconds³
  1395.                      ÀÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ
  1396.  
  1397.     If the output buffer is empty, the timeout value is halved. In
  1398.     general, this is the case if the number of tries is greater than zero
  1399.     and during the init and end sequences. These timeouts are not fatal
  1400.     situations, they just give the remote a reasonable amount of time to
  1401.     receive and respond to a packet before a retry occurs. Duplicate
  1402.     packets are always identified and ignored. A retry counter is reset
  1403.     if there is a change of state, or a reposition different from the
  1404.     previous file offset occurs.
  1405.  
  1406.     The braindead timer monitors useful data from the other side: a first
  1407.     response to a transmitted supervisiory packet, or a received packet
  1408.     with file data at the correct offset. Device packets and packets that
  1409.     do not signify any progress of the protocol do not affect the
  1410.     braindead timer.
  1411.  
  1412.     No other timers (such as one between characters in a packet) are
  1413.     necessary.
  1414.  
  1415.  
  1416.     Aborting a session
  1417.     ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
  1418.     A session is aborted with five consequetive CAN (^X or ASCII 24)
  1419.     characters. Whenever a state table mentions "Abort", the following
  1420.     procedure is to be followed:
  1421.  
  1422.     Clear the output buffer and transmit eight CAN characters followed by
  1423.     ten BS (^H or ASCII 8) characters; wait a few seconds for the data to
  1424.     be transmitted to the remote, purge the input buffer and exit the
  1425.     protocol code.
  1426.  
  1427.  
  1428. GENERAL sender (txstate HTX_...)
  1429. ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ¿
  1430. ³State   ³Predicate(s)                  ³Action(s)                 ³Next state³
  1431. ÃÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1432. ³Begin   ³                              ³txretries = 0             ³START     ³
  1433. ³        ³                              ³reset txtimer             ³          ³
  1434. ³        ³                              ³blksize = startblksize    ³          ³
  1435. ³        ³                              ³goodbytes = 0             ³          ³
  1436. ³        ³                              ³goodneeded = 1024         ³          ³
  1437. ³        ³                              ³braintimer = 120          ³          ³
  1438. ÃÄÄÄÄÄÄÄÄÅÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1439. ³START   ³1³txretries == 10             ³Report too many errors    ³Abort     ³
  1440. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1441. ³        ³2³else (txretries < 10)       ³txstr AutoStart           ³SWAIT     ³
  1442. ³        ³ ³                            ³txpkt START               ³          ³
  1443. ³        ³ ³                            ³txtimer = 5               ³          ³
  1444. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1445. ³SWAIT   ³1³rxpkt START or              ³txretries = 0             ³INIT      ³
  1446. ³        ³ ³rxpkt INIT                  ³reset txtimer             ³          ³
  1447. ³        ³ ³                            ³braintimer = 120          ³          ³
  1448. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1449. ³        ³2³txtimer expired             ³Report tx timeout         ³START     ³
  1450. ³        ³ ³                            ³increment txretries       ³          ³
  1451. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1452. ³INIT    ³1³txretries == 10             ³Report too many errors    ³Abort     ³
  1453. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1454. ³        ³2³else (txretries < 10)       ³txpkt INIT(linkinfo)      ³INITACK   ³
  1455. ³        ³ ³                            ³txtimer = timeout/2       ³          ³
  1456. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1457. ³INITACK ³1³rxpkt INITACK               ³txretries = 0             ³RINIT     ³
  1458. ³        ³ ³                            ³reset txtimer             ³          ³
  1459. ³        ³ ³                            ³braintimer = 120          ³          ³
  1460. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1461. ³        ³2³txtimer expired             ³Report tx timeout         ³INIT      ³
  1462. ³        ³ ³                            ³increment txretries       ³          ³
  1463. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1464. ³RINIT   ³1³rxstate != INIT             ³                          ³NextFile  ³
  1465. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1466. ³NextFile³1³No files left?              ³Report end of batch       ³ToFName   ³
  1467. ³        ³ ³                            ³Set NULL fileinfo         ³          ³
  1468. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1469. ³        ³2³Can access next file?       ³Set up fileinfo           ³ToFName   ³
  1470. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1471. ³        ³3³Can't access file?          ³Report access failure     ³NextFile  ³
  1472. ÃÄÄÄÄÄÄÄÄÅÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1473. ³ToFName ³                              ³txsyncid = 0              ³FINFO     ³
  1474. ³        ³                              ³txretries = 0             ³          ³
  1475. ³        ³                              ³reset txtimer             ³          ³
  1476. ÃÄÄÄÄÄÄÄÄÅÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1477. ³FINFO   ³1³txretries == 10             ³Report too many errors    ³Abort     ³
  1478. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1479. ³        ³2³txretries > 0               ³txpkt FINFO(fileinfo)     ³FINFOACK  ³
  1480. ³        ³ ³                            ³txtimer = timeout/2       ³          ³
  1481. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1482. ³        ³3³else (txretries == 0)       ³txpkt FINFO(fileinfo)     ³FINFOACK  ³
  1483. ³        ³ ³                            ³txtimer = timeout         ³          ³
  1484. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1485. ³FINFOACK³1³NULL fname (end of batch) & ³txtimer = idletimeout     ³REND      ³
  1486. ³        ³ ³rxpkt FINFOACK              ³braintimer = 120          ³          ³
  1487. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1488. ³        ³2³rxpkt FINFOACK &            ³txpos = FINFOACK(pos)     ³DATA      ³
  1489. ³        ³ ³FINFOACK(pos) >= 0          ³txretries = 0             ³          ³
  1490. ³        ³ ³                            ³txlastack = 0             ³          ³
  1491. ³        ³ ³                            ³braintimer = 120          ³          ³
  1492. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1493. ³        ³3³rxpkt FINFOACK &            ³They already have file    ³NextFile  ³
  1494. ³        ³ ³FINFOACK(pos) == -1)        ³braintimer = 120          ³          ³
  1495. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1496. ³        ³4³rxpkt FINFOACK &            ³Skip this file for now    ³NextFile  ³
  1497. ³        ³ ³FINFOACK(pos) == -2)        ³braintimer = 120          ³          ³
  1498. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1499. ³        ³5³txtimer expired             ³Report tx timeout         ³FINFO     ³
  1500. ³        ³ ³                            ³inrease txretries         ³          ³
  1501. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1502. ³DATA    ³1³rxstate != Done &           ³txtimer = idletimeout     ³XWAIT     ³
  1503. ³        ³ ³hdxlink == True             ³                          ³          ³
  1504. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1505. ³        ³2³rxpkt DATAACK &             ³txlastack = DATAACK(pos)  ³          ³
  1506. ³        ³ ³DATAACK(pos) > txlastack    ³                          ³          ³
  1507. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1508. ³        ³3³rxpkt RPOS &                ³Skip this file for now    ³SkipFile  ³
  1509. ³        ³ ³RPOS(pos) < 0               ³braintimer = 120          ³          ³
  1510. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1511. ³        ³4³rxpkt RPOS &                ³Report too many errors    ³Abort     ³
  1512. ³        ³ ³RPOS(id) == txsyncid &      ³                          ³          ³
  1513. ³        ³ ³inc txretries == 10         ³                          ³          ³
  1514. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1515. ³        ³5³rxpkt RPOS &                ³txpos = RPOS(pos)         ³          ³
  1516. ³        ³ ³RPOS(id) != txsyncid &      ³txsyncid = RPOS(id)       ³          ³
  1517. ³        ³ ³RPOS(pos) >= 0              ³txretries = 1             ³          ³
  1518. ³        ³ ³                            ³blksize = RPOS(blksize)   ³          ³
  1519. ³        ³ ³                            ³goodbytes = 0             ³          ³
  1520. ³        ³ ³                            ³inc goodneeded + 1024     ³          ³
  1521. ³        ³ ³                            ³if (goodneeded > 8192)    ³          ³
  1522. ³        ³ ³                            ³   goodneeded = 8192      ³          ³
  1523. ³        ³ ³                            ³braintimer = 120          ³          ³
  1524. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1525. ³        ³6³File seek/read error or     ³Skip this file for now    ³SkipFile  ³
  1526. ³        ³ ³user wishes to skip file    ³                          ³          ³
  1527. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1528. ³        ³7³txwindow &                  ³if (txretries > 0)        ³DATAACK   ³
  1529. ³        ³ ³txpos >= txlastack+txwindow ³   txtimer = timeout/2    ³          ³
  1530. ³        ³ ³                            ³else                      ³          ³
  1531. ³        ³ ³                            ³   txtimer = timeout      ³          ³
  1532. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1533. ³        ³8³Enough room in output &     ³txpkt DATA(pos,data)      ³          ³
  1534. ³        ³ ³more filedata(blksize) to go³txpos += datalen          ³          ³
  1535. ³        ³ ³                            ³inc goodbytes + datalen   ³          ³
  1536. ³        ³ ³                            ³if goodbytes > goodneeded ³          ³
  1537. ³        ³ ³                            ³   Store txpos,blksize    ³          ³
  1538. ³        ³ ³                            ³   blksize * 2 (max.2048) ³          ³
  1539. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1540. ³        ³9³End of filedata reached     ³                          ³EOF       ³
  1541. ÃÄÄÄÄÄÄÄÄÅÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1542. ³SkipFile³                              ³txpos = -1                ³EOF       ³
  1543. ³        ³                              ³txretries = 0             ³          ³
  1544. ÃÄÄÄÄÄÄÄÄÅÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1545. ³DATAACK ³1³txretries == 10             ³Report too many errors    ³Abort     ³
  1546. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1547. ³        ³2³rxpkt DATAACK &             ³txlastack = DATAACK(pos)  ³DATA      ³
  1548. ³        ³ ³DATAACK(pos) > txlastack &  ³txretries = 0             ³          ³
  1549. ³        ³ ³txpos < DATAACK(pos) + txwin³reset txtimer             ³          ³
  1550. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1551. ³        ³3³rxpkt RPOS                  ³Handle RPOS in state DATA ³          ³
  1552. ³        ³ ³                            ³but stay in this state    ³          ³
  1553. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1554. ³        ³4³txtimer expired             ³Report tx timeout         ³DATA      ³
  1555. ³        ³ ³                            ³increment txretries       ³          ³
  1556. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1557. ³XWAIT   ³1³rxstate == Done             ³reset txtimer             ³DATA      ³
  1558. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1559. ³        ³2³rxpkt DATAACK &             ³txlastack = DATAACK(pos)  ³          ³
  1560. ³        ³ ³DATAACK(pos) > txlastack    ³                          ³          ³
  1561. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1562. ³        ³3³rxpkt RPOS                  ³Handle RPOS in state DATA ³          ³
  1563. ³        ³ ³                            ³but stay in this state    ³          ³
  1564. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1565. ³        ³4³rxpkt IDLE                  ³hdxlink = False           ³DATA      ³
  1566. ³        ³ ³                            ³reset txtimer             ³          ³
  1567. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1568. ³        ³5³txtimer expired             ³txpkt IDLE                ³          ³
  1569. ³        ³ ³                            ³txtimer = idletimeout     ³          ³
  1570. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1571. ³EOF     ³1³txretries == 10             ³Report too many errors    ³Abort     ³
  1572. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1573. ³        ³2³txretries > 0               ³txpkt EOF(txpos)          ³EOFACK    ³
  1574. ³        ³ ³                            ³txtimer = timeout/2       ³          ³
  1575. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1576. ³        ³3³else (txretries == 0)       ³txpkt EOF(txpos)          ³EOFACK    ³
  1577. ³        ³ ³                            ³txtimer = timeout         ³          ³
  1578. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1579. ³EOFACK  ³1³rxpkt EOFACK                ³braintimer = 120          ³NextFile  ³
  1580. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1581. ³        ³2³rxpkt DATAACK &             ³txlastack = DATAACK(pos)  ³          ³
  1582. ³        ³ ³DATAACK(pos) > txlastack    ³                          ³          ³
  1583. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1584. ³        ³3³rxpkt RPOS &                ³rxpos == -2               ³EOF       ³
  1585. ³        ³ ³RPOS(pos) == -2 &           ³                          ³          ³
  1586. ³        ³ ³rxpos != -2                 ³                          ³          ³
  1587. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1588. ³        ³4³rxpkt RPOS &                ³Handle as in state DATA   ³DATA      ³
  1589. ³        ³ ³RPOS(pos) >= 0              ³                          ³          ³
  1590. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1591. ³        ³5³txtimer expired             ³Report tx timeout         ³EOF       ³
  1592. ³        ³ ³                            ³increment txretries       ³          ³
  1593. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1594. ³REND    ³1³rxstate == DONE &           ³txretries = 0             ³END       ³
  1595. ³        ³ ³devtxstate == DONE          ³                          ³          ³
  1596. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1597. ³        ³2³txtimer expired             ³txpkt IDLE                ³          ³
  1598. ³        ³ ³                            ³txtimer = idletimeout     ³          ³
  1599. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1600. ³END     ³1³txretries == 10             ³                          ³Abort     ³
  1601. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1602. ³        ³2³else (txretries < 10)       ³txpkt END (twice)         ³ENDACK    ³
  1603. ³        ³ ³                            ³txtimer = timeout/2       ³          ³
  1604. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1605. ³ENDACK  ³1³rxpkt END                   ³txpkt END (thrice)        ³Done      ³
  1606. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1607. ³        ³2³txtimer expired             ³Report tx timeout         ³END       ³
  1608. ³        ³ ³                            ³increment txretries       ³          ³
  1609. ÀÄÄÄÄÄÄÄÄÁÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ
  1610.  
  1611.  
  1612.  
  1613. GENERAL RECEIVER (rxstate HRX_...)
  1614. ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄ¿
  1615. ³State   ³Predicate(s)                  ³Action(s)                 ³Next state³
  1616. ÃÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1617. ³Begin   ³                              ³reset rxtimer             ³START     ³
  1618. ³        ³                              ³lastrxdlen = startblksize ³          ³
  1619. ³        ³                              ³(tx handles braintimer)   ³          ³
  1620. ÃÄÄÄÄÄÄÄÄÅÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1621. ³INIT    ³1³rxpkt INIT &                ³txpkt INITACK             ³FINFO     ³
  1622. ³        ³ ³INIT(options) are compatible³Set options               ³          ³
  1623. ³        ³ ³                            ³braintimer = 120          ³          ³
  1624. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1625. ³        ³2³INIT(options) not compatible³Report link failure       ³Abort     ³
  1626. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1627. ³FINFO   ³1³rxpkt INIT (apparent dup)   ³txpkt INITACK             ³          ³
  1628. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1629. ³        ³2³rxpkt FINFO &               ³Report end of batch       ³          ³
  1630. ³        ³ ³FINFO(fileinfo) == Empty    ³txpkt FINFOACK            ³DONE      ³
  1631. ³        ³ ³                            ³braintimer = 120          ³          ³
  1632. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1633. ³        ³3³rxpkt FINFO &               ³do not want this file     ³          ³
  1634. ³        ³ ³we already have file        ³txpkt FINFOACK(-1)        ³          ³
  1635. ³        ³ ³                            ³braintimer = 120          ³          ³
  1636. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1637. ³        ³4³rxpkt FINFO &               ³Skip this file for now    ³          ³
  1638. ³        ³ ³open/diskspace error        ³txpkt FINFOACK(-2)        ³          ³
  1639. ³        ³ ³                            ³braintimer = 120          ³          ³
  1640. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1641. ³        ³5³rxpkt FINFO &               ³rxpos = resume offset     ³ToData    ³
  1642. ³        ³ ³file we want to resume      ³                          ³          ³
  1643. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1644. ³        ³6³rxpkt FINFO &               ³rxpos = 0                 ³ToData    ³
  1645. ³        ³ ³new file for us             ³                          ³          ³
  1646. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1647. ³        ³7³rxpkt EOF (apparent dup)    ³txpkt EOFACK              ³          ³
  1648. ÃÄÄÄÄÄÄÄÄÅÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1649. ³ToData  ³                              ³txpkt FINFOACK(rxpos)     ³DATA      ³
  1650. ³        ³                              ³rxsyncid = 0              ³          ³
  1651. ³        ³                              ³rxlastsync = 0;           ³          ³
  1652. ³        ³                              ³rxretries = 0             ³          ³
  1653. ³        ³                              ³reset rxtimer             ³          ³
  1654. ³        ³                              ³braintimer = 120          ³          ³
  1655. ÃÄÄÄÄÄÄÄÄÅÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1656. ³DATA    ³1³rxpkt FINFO (apparent dup)  ³txpkt FINFOACK(rxpos)     ³          ³
  1657. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1658. ³        ³2³rxpkt DATA &                ³Store data                ³          ³
  1659. ³        ³ ³DATA(pos) == rxpos          ³rxpos += datalen          ³          ³
  1660. ³        ³ ³                            ³rxretries = 0             ³          ³
  1661. ³        ³ ³                            ³rxlastsync = rxpos        ³          ³
  1662. ³        ³ ³                            ³reset rxtimer             ³          ³
  1663. ³        ³ ³                            ³braintimer = 120          ³          ³
  1664. ³        ³ ³                            ³if (rxwindow)             ³          ³
  1665. ³        ³ ³                            ³   txpkt DATAACK(rxpos)   ³          ³
  1666. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1667. ³        ³3³rxpkt DATA &                ³Report bad rxpos          ³BadPos    ³
  1668. ³        ³ ³DATA(pos) != rxpos          ³                          ³          ³
  1669. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1670. ³        ³4³rxpkt EOF &                 ³Close file, received ok   ³OkEOF     ³
  1671. ³        ³ ³EOF(pos) == rxpos           ³                          ³          ³
  1672. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1673. ³        ³5³rxpkt EOF &                 ³Close, save for resume    ³OkEOF     ³
  1674. ³        ³ ³EOF(pos) == -2              ³                          ³          ³
  1675. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1676. ³        ³6³rxpkt EOF &                 ³Report bad EOF            ³BadPos    ³
  1677. ³        ³ ³EOF(pos) != rxpos           ³                          ³          ³
  1678. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1679. ³        ³7³File write error or         ³Close, save for resume    ³          ³
  1680. ³        ³ ³user wishes to skip file    ³rxpos = -2                ³          ³
  1681. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1682. ³        ³8³rxpkt IDLE &                ³braintimer = 120          ³          ³
  1683. ³        ³ ³hdxlink == False            ³                          ³          ³
  1684. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1685. ³BadPos  ³1³DATA/EOF(pos) <= rxlastsync ³rxretries = 0             ³Timer     ³
  1686. ³        ³ ³                            ³reset rxtimer             ³          ³
  1687. ³        ³ ³                            ³rxlastsync = pos          ³          ³
  1688. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1689. ³        ³2³DATA/EOF(pos) > rxlastsync  ³rxlastsync = pos          ³Timer     ³
  1690. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1691. ³Timer   ³1³rxtimer expired             ³                          ³HdxLink   ³
  1692. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1693. ³        ³2³else (rxtimer not expired)  ³                          ³DATA      ³
  1694. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1695. ³HdxLink ³1³rxretries > 4 &             ³hdxlink = True            ³Retries   ³
  1696. ³        ³ ³txstate < REND &            ³rxretries = 0             ³          ³
  1697. ³        ³ ³originator == False &       ³                          ³          ³
  1698. ³        ³ ³hdxlink == False            ³                          ³          ³
  1699. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1700. ³        ³2³else (above not the case)   ³                          ³Retries   ³
  1701. ÃÄÄÄÄÄÄÄÄÅÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1702. ³Retries ³1³inc rxretries == 10         ³Report too many errors    ³Abort     ³
  1703. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1704. ³        ³2³rxretries == 1              ³increase rxsyncid         ³RPos      ³
  1705. ³        ÃÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1706. ³        ³3³else (rxretries > 1)        ³                          ³RPos      ³
  1707. ÃÄÄÄÄÄÄÄÄÅÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1708. ³RPos    ³                              ³lastrxdatalen/=2 (min.64) ³DATA      ³
  1709. ³        ³                              ³txpkt RPOS (rxpos,        ³          ³
  1710. ³        ³                              ³   lastrxdatalen,rxsyncid)³          ³
  1711. ³        ³                              ³rxtimer = timeout         ³          ³
  1712. ÃÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1713. ³OkEOF   ³                              ³txpkt EOFACK              ³FINFO     ³
  1714. ³        ³                              ³reset rxtimer             ³          ³
  1715. ³        ³                              ³braintimer = 120          ³          ³
  1716. ÃÄÄÄÄÄÄÄÄÅÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ´
  1717. ³DONE    ³1³rxpkt FINFO (apparent dup)  ³txpkt FINFOACK(-2)        ³          ³
  1718. ÀÄÄÄÄÄÄÄÄÁÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÙ
  1719.  
  1720.  
  1721.     HYDRA in FidoNet technology mailers
  1722.     ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
  1723.     HYDRA is suitable for use in FidoNet mailers. It can be implemented
  1724.     for EMSI and FTS-6 mail sessions. The FTS-6 (YooHoo) capability bit
  1725.     for HYDRA is 0x0020 (DOES_HYDRA). The EMSI and IEMSI protocol
  1726.     capability flag is HYD.
  1727.  
  1728.     When utilizing HYDRA in a mail session, two complete batches are
  1729.     always performed. Little else differs from a normal FTS-6 ZedZap mail
  1730.     session. The first batch is used to transmit all mail, files, and
  1731.     file requests by both sides. The second batch is always performed,
  1732.     sending nothing if there are no file requests to honor. The data
  1733.     buffers are not purged between the two batches since HYDRA ignores
  1734.     any leftovers from the previous batch (END packets, etc.).
  1735.  
  1736.     To integrate HYDRA into an existing mailer, the same code used for
  1737.     the ZedZap session flow can be used, but instead of one transmit and
  1738.     one receive session, two transmit sessions (or batches) are used.
  1739.     When the HYDRA end of batch is initiated it will not be terminated
  1740.     until an end of batch has been received from the remote and the end
  1741.     of session sequence has been finished.
  1742.  
  1743.     Fido and FidoNet are registered marks of Tom Jennings and Fido
  1744.     Software.
  1745.  
  1746.  
  1747.     Error detection using CRCs
  1748.     ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
  1749.     CRC (Cyclic Redundancy Check) values only provide their promised
  1750.     maximum error detection capability when properly applied, which
  1751.     involves calculating and transmitting low-bit first, presetting the
  1752.     CRC with all ones, and transmitting the ones' complement of the
  1753.     result. The receiver also initializes to all ones, processes all of
  1754.     the data AND the following CRC, and the result should match a "magic
  1755.     value" which is 0xf0b8 for the 16-bit CRC and 0xdebb20e3 for the
  1756.     32-bit CRC.
  1757.  
  1758.     The easiest and fastest way to perform CRC calculations is by using a
  1759.     table that does the algorithm's shift-operations in 8-bits at a time.
  1760.  
  1761.  
  1762.     CRC-16 error detection
  1763.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  1764.     16-bit CRC using the CCITT CRC-16 polynomial. This is the default at
  1765.     startup, and always used for HEX packets even if both sides are
  1766.     capable of handling 32-bit CRCs.
  1767.  
  1768.     This CRC-16 is not identical to the one used by the Xmodem and Zmodem
  1769.     file transfer protocols. The polynomial is the same
  1770.     (X^16+X^12+X^5+X^0 or 0x8408) but the bit-ordering is the opposite,
  1771.     and preconditioning and postconditioning is used as in 32-bit CRCs.
  1772.     This method is also used by the European version of X.25.
  1773.  
  1774.     The 16-bit CRC table is created as follows (pseudocode, the variable
  1775.     CRC16 and the table of 256 entries are 16-bit unsigned integers):
  1776.  
  1777.         FOR (i=0 TO 255)
  1778.             {
  1779.             CRC16=i
  1780.             FOR (N=1 TO 8)
  1781.                 {
  1782.                 IF (CRC16 AND 1)
  1783.                     CRC16=(CRC16 >> 1) XOR 0x8408
  1784.                 ELSE
  1785.                     CRC16=CRC16 >> 1
  1786.                 }
  1787.             CRC16TAB[i]=CRC16;
  1788.             }
  1789.  
  1790.     When processing data, each byte is run through the CRC calculation
  1791.     routine as follows (variable CRC stores the 16-bit CRC value/result,
  1792.     C is the next 8-bit char):
  1793.  
  1794.         CRC=CRC16TAB[(CRC XOR C) AND 0xff] XOR ((CRC>>8) AND 0x00ff)
  1795.  
  1796.  
  1797.     CRC-32 error detection
  1798.     ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  1799.     32-bit CRC using the CCITT CRC-32 polynomial. Support of CRC-32 is
  1800.     optional and signalled in the INIT packet.
  1801.  
  1802.     If both sides indicate they can handle CRC-32, all packets except
  1803.     those transmitted in HEX format use this algorithm instead of CRC-16
  1804.     to improve error detection.
  1805.  
  1806.     This CRC-32 is identical to the one used by the Zmodem protocol.
  1807.     The polynomial is (0xedb88320):
  1808.  
  1809.     X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0
  1810.  
  1811.     The principal method of calculation, transmission, and checking is
  1812.     identical to CRC-16 as described above, but the "magic value" for
  1813.     32-bit CRC is 0xdebb20e3.
  1814.  
  1815.     The CRC-32 table is created as follows (pseudocode, the variable
  1816.     CRC32 and the table of 256 entries are 32-bit unsigned integers):
  1817.  
  1818.     FOR (i=0 TO 255)
  1819.         {
  1820.         CRC32=i
  1821.         FOR (N=1 TO 8)
  1822.             {
  1823.             IF (CRC32 AND 1)
  1824.                 CRC32 = (CRC32 >> 1) XOR 0xedb88320
  1825.             ELSE
  1826.                 CRC32 = CRC32 >> 1
  1827.             }
  1828.         CRC32TAB[i] = CRC32;
  1829.         }
  1830.  
  1831.     When processing data, each byte is run through the CRC calculation
  1832.     routine as follows (variable CRC stores the 32-bit CRC value/result,
  1833.     C is the next 8-bit character):
  1834.  
  1835.         CRC=CRC32TAB[(CRC XOR C) AND 0xFF] XOR ((CRC>>8) AND 0x00ffffff)
  1836.  
  1837.  
  1838.     The authors
  1839.     ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
  1840.     The authors can be reached at the following addresses:
  1841.  
  1842.     Joaquim H. Homrighausen                    Arjen G. Lentz
  1843.     389, route d'Arlon                         Lentz Software Development
  1844.     L-8011 Strassen                            Langegracht 7B
  1845.     Luxembourg                                 3811 BT Amersfoort
  1846.                                                The Netherlands
  1847.     joho@ae.lu
  1848.     FidoNet 2:270/17                           aglentz@fido.lu
  1849.                                                FidoNet 2:283/512
  1850.  
  1851.  
  1852.     The name HYDRA
  1853.     ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
  1854.     Hydra is a greek mythological creature (the watersnake). Like the
  1855.     Nemeic lion, Hydra is the daughter of the giant Typhon and the snake
  1856.     Echidna.
  1857.  
  1858.     She grew up in the marshes of Lerna near/in Argolis (Argos). There
  1859.     she ate entire herds of cattle and destroyed large cropfields. Later,
  1860.     she lived in caves on a hill near the spring of Amymone.
  1861.  
  1862.     Hydra is a monstrous large snake with nine heads: eight mortal ones,
  1863.     and one (the middle one) immortal. She was defeated and killed by
  1864.     Heracles (Hercules) - son of Zeus and Alcemene, grandson of Perseus -
  1865.     as the second of his twelve tasks, with the help of his cousin
  1866.     Iolaos. Every time he cut of one of the heads with his sword, two new
  1867.     heads grew in its place. So Iolaos scorched the wound of each cut off
  1868.     head with burning branches so the head couldn't grow on again.
  1869.  
  1870.     Heracles buried the last and immortal head under a stone nearby. He
  1871.     also dipped his arrows in Hydra's poisonous blood, thereafter the
  1872.     wounds caused by those arrows were incurable.
  1873.  
  1874.  
  1875.     Also star constellation (sign of the watersnake) in the equatorial
  1876.     zone.
  1877.  
  1878.  
  1879.     Also a type of sweetwater polip (the Hydroidea Thin, tubeshaped body
  1880.     can be full contracted, just like the six (or more) tentacles. There
  1881.     is no generation change, the gender-products grow directly on the
  1882.     body.
  1883.  
  1884.     The animals catch their prey with nettlecells, and are very verocious.
  1885.     They can be found in various stilstanding and flowing water and were
  1886.     first described by Anthonie van Leeuwenhoek in the year 1704.
  1887.  
  1888.  
  1889.     Also small island (spelled Idhra in modern Greek) of the Sargonic
  1890.     group in the Aegean Sea, just of the eastern tip of the Argolis
  1891.     peninsula of the Peloponesus (Attika). Its length (NE/SW) is 21 km,
  1892.     with a total area of 49,6 square km. Its highest point is 597 meters
  1893.     above sea level. Population of 2794 (latest census: 1981). Only one
  1894.     real city with the same name as the island. Once quite wooded and
  1895.     well watered, now denuded and dry, with almost no arable land
  1896.     (infertile limestone). Certain times of the year the people have to
  1897.     ship in water from the main land. Its Turkish name is Camliza which
  1898.     means "Place of Pines".
  1899.  
  1900.     References:
  1901.          Dutch:  Oosthoeks Encyclopedie
  1902.                  Grote Winklerprins Encyclopedie
  1903.        English:  Encyclopaedia Brittannica
  1904.  
  1905.     --- end of "hydra.doc" ---
  1906.